/*
 *  Copyright (C) 2010 Jonathan MERCIER <bioinfornatics@fedoraproject.org>,
 *  Louise-Amélie SCHMITT <louise-amelie.schmitt@etu.u-bordeaux1.fr>,
 *  Florence Maurier <florence_maurier@orange.fr>,
 *  Marianne Dussart <marianne.dussart@orange.fr>,
 *  Nicolas Fontaine <nifontaine@gmail.com>
 *
 *  JACoMode is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  JACoMode is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with JACoMode.  If not, see <http://www.gnu.org/licenses/>.
 */
package fr.ubdx1.jacomode.view;

import java.util.ArrayList;
/**
 *
 * @author Jonathan MERCIER <bioinfornatics@fedoraproject.org>,Louise-Amélie SCHMITT <louise-amelie.schmitt@etu.u-bordeaux1.fr>,Florence Maurier <florence_maurier@orange.fr>,Marianne Dussart <marianne.dussart@orange.fr>,Nicolas Fontaine <nifontaine@gmail.com>
 */
public class ArrayView {
    private String table;

    /**
     * Process table for OverallResult
     * @param inner
     * @param outer
     * @param nb_EFM
     * @param num_EFM
     * @return table
     */
    public String bilanResult1(ArrayList inner, ArrayList outer, ArrayList nb_EFM, ArrayList num_EFM){
        table = "<center><table>";
        table = table+"<tr><td colspan=2>Overall reaction</td><td rowspan=2>Number of EFMs</td><td rowspan=2>EFM's Id</td></tr>";
        table = table+"<tr><td>Inner</td><td>Outer</td></tr>";
        for (int i = 0; i<inner.size(); i++)
            table = table+"<tr><td>"+inner.get(i)+"</td><td>"+outer.get(i)+"</td><td>"+nb_EFM.get(i)+"</td><td>"+num_EFM.get(i)+"</td></tr>";
        table = table+"</table></center>";
        return table;
    }
    /**
     * Process table for OverallSearch
     * @param EFM
     * @param inner
     * @param outer
     * @return table
     */
    public String bilanResult2(ArrayList EFM, ArrayList inner, ArrayList outer){
        table = "<center><table>";
        table = table+"<tr><td rowspan=2>efm</td><td colspan=2>Overall reaction</td></tr>";
        table = table+"<tr><td>Inner</td><td>Outer</td></tr>";
        for (int i = 0; i<EFM.size(); i++)
            table = table+"<tr><td>"+EFM.get(i)+"</td><td>"+inner.get(i)+"</td><td>"+outer.get(i)+"</td></tr>";
        table = table+"</center></table>";
        return table;
    }
    
    /**
     * Process table for CompareResult
     * @param sigma
     * @param epsilon
     * @param nbclass
     * @param noise
     * @param total
     * @return table
     */
    public String resultCompare(ArrayList sigma, ArrayList epsilon, ArrayList nbclass, ArrayList noise, ArrayList total){//idem
        table="<center><table>";
        table= table+"<tr><td>&sigma;</td><td>&epsilon;</td><td>Number of classes</td><td>Noise</td><td>Total number of motifs</td></tr>";
        for (int i = 0; i<noise.size(); i++)
            table=table+"<tr><td>"+sigma.get(i)+"</td><td>"+epsilon.get(i)+"</td><td>"+nbclass.get(i)+"</td><td>"+noise.get(i)+"</td><td>"+total.get(i)+"</td></tr>";
        table = table+ "</center></table>";
        return table;
    }
}